package com.qijian.maindata.domain.query;

import com.baomidou.mybatisplus.annotation.TableName;
import com.qijian.common.utils.mybatis.WhereType;
import com.qijian.common.utils.mybatis.WhereTypeEnum;
import lombok.Data;
import lombok.ToString;

import java.math.BigDecimal;
import java.util.Set;


/**
 * 物料需求对象 查询条件类
 *
 * @author qijian
 * @date 2021-09-03
 */

@Data
@ToString
@TableName("main_line_process_item")
public class LineProcessItemQuery {

    @WhereType(filed = "demand_id")
    private Long demandId;
    @WhereType(filed = "demand_id", type = WhereTypeEnum.IN)
    private Set<Long> ids;
    @WhereType(filed = "demand_id", type = WhereTypeEnum.NOTIN)
    private Set<Long> idsNot;
    @WhereType(filed = "line_id")
    private Long lineId;
    @WhereType(filed = "line_id", type = WhereTypeEnum.NULL)
    private Boolean lineIdIsNull;
    @WhereType(filed = "line_code")
    private String lineCode;
    @WhereType(filed = "process_id")
    private Long processId;
    @WhereType(filed = "process_id", type = WhereTypeEnum.NULL)
    private Boolean processIdIsNull;
    @WhereType(filed = "process_code")
    private String processCode;
    @WhereType(filed = "process_code", type = WhereTypeEnum.IN)
    private Set<String> processCodes;
    @WhereType(filed = "process_id", type = WhereTypeEnum.IN)
    private Set<Long> processIds;
    @WhereType(filed = "bom_id")
    private Long bomId;
    @WhereType(filed = "bom_id", type = WhereTypeEnum.IN)
    private Set<Long> bomIds;
    @WhereType(filed = "item_id")
    private Long itemId;
    @WhereType(filed = "item_id", type = WhereTypeEnum.NOTIN)
    private Set<Long> itemIdsNot;
    @WhereType(filed = "item_code")
    private String itemCode;
    @WhereType(filed = "item_name")
    private String itemName;
    @WhereType(filed = "item_units")
    private String itemUnits;
    @WhereType(filed = "quantity")
    private BigDecimal quantity;

    @WhereType(func = "{2} NOT IN (SELECT item_id FROM main_bom_detail WHERE bom_id = {1} AND is_del = 0)", filed = "item_id")
    private Long itemIdNotInBom;
    @WhereType(func = "{2} IN (SELECT detail_id FROM main_bom_detail WHERE bom_id = {1} AND is_del = 0)", filed = "bom_id")
    private Long bomIdIn;
    @WhereType(filed = "item_classify", tableName = "main_item")
    private String itemClassify;
}
